package cn.mw.cmdb.timetask.entity;

import cn.mw.cmdb.entity.PropertyTypeInt;
import cn.mw.cmdb.entity.PropertyTypeList;
import cn.mw.cmdb.entity.PropertyTypeString;
import cn.mw.components.mongodb.anno.AutoId;
import cn.mw.components.mongodb.anno.CMDBProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.util.List;

/**
 * @author gengjb
 * @description 定时任务类型数据
 * @date 2024/11/4 10:28
 */
@Getter
@Setter
@Schema(name = "MwTimeTaskTypeDto", description = "定时任务信息")
@Document("mw_cmdbmd_timetask")
public class MwTimeTaskTypeDto implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "主键")
    @CMDBProperty(searchType = PropertyTypeString.ID, searchPrefix = "_", isShow = true)
    @AutoId
    private String id;

    @Schema(description = "任务类型,1：系统任务，2：自定义任务")
    @CMDBProperty(searchType = PropertyTypeInt.ID ,keywordSearch = true)
    private Integer taskType;

    @Schema(description = "任务模块")
    @CMDBProperty(searchType = PropertyTypeString.ID ,keywordSearch = true)
    @NotBlank(message = "{time-task-module-name}")
    private String taskModule;

    @Schema(description = "模块下的任务")
    @CMDBProperty(searchType = PropertyTypeList.ID ,keywordSearch = true)
    private List<Long> timeTaskIds;
}
